<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
	$(function(){
		
	})
	function del(deptNo){
		alert(deptNo);
		$.post("/del",{"deptNo":deptNo},function(data){
			alert(data);
			if(data.msg=="true"){
				alert("删除成功！");
			}else{
				alert("删除失败");
			}
		})
	}
	function btn(){
		var dname=document.getElementsByName("dname")[0].value;
		var loc=document.getElementsByName("loc")[0].value;
		alert(dname);
		alert(loc);
		location.href="/dept?dname="+dname+"&loc="+loc;
	}
	function saoma(){
		$("div").find("*").remove();
		$("div").append("<span><img src='http://bshare.optimix.asia/barCode?site=weixin&url=http://www.xsyrz.cn'></span>"
			+"<input type='button' value='返回' onclick='back()'>")
		
	}
	function back(){
		window.location.reload();
	}
</script>
</head>
<body>
	<div>
		<p><input type="text" name="dname"></p>
		<p><input type="text" name="loc"></p>
		<input type="button" value="登录" onclick="btn();">
		<input type="button" value="删除" onclick="del('40');">
		<input type="button" value="扫码登录" onclick="saoma()">		
	</div>
<!-- 	<p>
			<span><img src="http://bshare.optimix.asia/barCode?site=weixin&url=http://www.xsyrz.cn"></span>
		</p> -->
</body>
</html>